<!DOCTYPE html> 
<html lang="en"> 
  <head> 
    <meta charset="utf-8"> 
    <title>RestRpc Dashboard</title> 
    <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
    <meta name="description" content=""> 
    <meta name="author" content=""> 
 
    <!-- Le styles --> 
    <link href="../css/bootstrap.min.css" rel="stylesheet"> 
    <link href="../css/bootstrap-responsive.min.css" rel="stylesheet"> 
    <link href="../css/docs.css" rel="stylesheet"> 
    <link href="../css/common.css" rel="stylesheet"> 
    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements --> 
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]--> 

  </head> 
 
  <body data-spy="scroll" data-target=".bs-docs-sidebar"> 

 
  <div class="container"> 
 
    <div class="row"> 
      <div class="span3 bs-docs-sidebar">
      </div>
     
      <div class="span9"> 
        <section> 
          <div class="page-header">
            <h1>Remote Service Definition Detail</h1>
          </div>

          <div class="row-fluid">
          	<p>Summary </p>
            <table id="summary" class="table table-bordered  table-striped">
				<thead>
				<tr>
				<th width='50%'>Name</th>
				<th>Value</th>
				</tr>
				</thead>
				<tbody>
				</tbody>
   			</table>
   			
          </div>
        </section> 
 
      </div> 
    </div> 
 
  </div> 
 
<script type="text/javascript" src="../js/jquery.min.js"></script> 
<script type="text/javascript" src="../js/common.js"></script> 
<script type="text/javascript" src="registry.js"></script> 
<script type="text/javascript" >
    $(document).ready(function() {
    	$.ajax({
			type: "GET",
			url: "serviceDefinitions.json",
			dataType: "json",
			data:restrpc.dashboard.windowLocationSearch(),
			success:function(json) {
	    		if (!json.succeed) {
	    			alert(json.message);
	    			return;
	    		}

	    		if (json.data == null) {
		    		return;
	    		}
	    		
	    		var summaryTbody = $("#summary tbody");
	    		summaryTbody.append("<tr><td>serviceName</td><td>"+json.data['serviceName']+"</td></tr>");
	    		summaryTbody.append("<tr><td>modified</td><td>"+json.data['modified']+"</td></tr>");
	    		summaryTbody.append("<tr><td>lastModifiedMillis</td><td>"+json.data['lastModifiedMillis']+"</td></tr>");

	    		var i=1;
	    		for (var p in json.data.remoteServiceDefinitions) {
	    			$('.row-fluid').append('<p>Definition '+(i++)+'</p>');
	    			var table = $('<table id="definition" class="table table-bordered  table-striped"> '+
						'<thead>'+
						'<tr>'+
						'<th width="50%">Name</th>'+
						'<th>Value</th>'+
						'</tr>'+
						'</thead>'+
						'<tbody>'+
						'</tbody>'+
		   				'</table>');
		    		
		    		var def = json.data.remoteServiceDefinitions[p];
		    		for (var p in def) {
		    			table.find('tbody').append("<tr><td>"+p+"</td><td>"+def[p]+"</td></tr>");
			    	}
			    	$('.row-fluid').append(table);
		    	}
			}
		});
        }
    );
</script>     

  </body> 
</html> 